[deps]
apr
musl

[deps.host]
pkgconf

[main]
filesize=635000
sha512=2893c8fc14e35d8016c69d36c05712f6f67acade2cf3079954a5626a15ad50ccf88b6e5d9a7458479fea8dfc9f4c8eaf53e5c343c80692208a4edb768d45a9ba

[mirrors]
http://archive.apache.org/dist/apr/apr-util-1.4.1.tar.bz2

[build]
cat << EOF > apr-1-config
#!/bin/sh
res=\$($butch_root_dir$butch_prefix/bin/apr-1-config "\$@")
rc=\$?
printf "%s\n" "\$res" | sed \
  -e 's,-I'$butch_prefix'/include,-I'"$butch_root_dir""$butch_prefix"/include',' \
  -e 's,-L'$butch_prefix'/lib,-L'"$butch_root_dir""$butch_prefix"/lib','
exit \$rc
EOF
chmod +x apr-1-config

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --with-apr="$PWD/apr-1-config" \
  --disable-util-dso || exit 1
echo '#define APR_HAVE_CRYPT_H 1' >> include/private/apu_config.h
"$K"/libtool.cross.gen --sysroot="$butch_root_dir"
make CC="$CC" -j$MAKE_THREADS LIBTOOL=$PWD/libtool || exit 1
make DESTDIR="$butch_install_dir" install || exit 1


